package com.lemon.cloud.admin.feign;

import com.lemon.cloud.comm.model.ResultMsg;
import com.lemon.cloud.comm.po.SysRole;
import com.lemon.cloud.comm.po.SysUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

import static com.lemon.cloud.comm.constants.OAuth2Constant.*;

/**
 * value:是nacos服务的spring.application.name
 * path:是nacos服务的server.servlet.context-path
 *
 * @author HuangDS
 */
@FeignClient(value = "admin-service", contextId="adminFeign")
public interface AdminFeign {

    @GetMapping(value = "/user/getByUsername", headers = {FROM + EQUAL + FROM_IN})
    ResultMsg<SysUser> getByUsername(@RequestParam(value = "username") String username);

    @GetMapping(value = "/user/getByMobile", headers = {FROM + EQUAL + FROM_IN})
    ResultMsg<SysUser> getByMobile(@RequestParam(value = "mobile") String mobile);

    @GetMapping(value ="/user/getRolesByUserId", headers = {FROM + EQUAL + FROM_IN})
    ResultMsg<List<SysRole>> getRolesByUserId(@RequestParam(value = "sysUserId") Long sysUserId);

}

